<?php
namespace Plugin\Alarm\Schema;

use Plugin\Alarm\Model\RdAlarmHandleRecord;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 报警处置记录
 */
#[Schema(title: 'RdAlarmHandleRecordSchema')]
class RdAlarmHandleRecordSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: 'id', type: 'bigint')]
    public string $id;

    #[Property(property: 'work_id', title: '工单id', type: 'bigint')]
    public string $work_id;

    #[Property(property: 'user_id', title: '处置人id', type: 'bigint')]
    public string $user_id;

    #[Property(property: 'handle_type', title: '处置类型', type: 'int')]
    public string $handle_type;

    #[Property(property: 'handle_info', title: '处置信息', type: 'json')]
    public string $handle_info;

    #[Property(property: 'created_at', title: 'created_at', type: 'timestamp')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'timestamp')]
    public string $updated_at;




    public function __construct(RdAlarmHandleRecord $model)
    {
       $this->id = $model->id;
       $this->work_id = $model->work_id;
       $this->user_id = $model->user_id;
       $this->handle_type = $model->handle_type;
       $this->handle_info = $model->handle_info;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'work_id' => $this->work_id ,'user_id' => $this->user_id ,'handle_type' => $this->handle_type ,'handle_info' => $this->handle_info ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at];
    }
}